Proper connect_port
[juce-lv2.git] / juce / source / extras / the jucer / src / ui / jucer_JucerDocumentHolder.h
blob8079d32ad26643dcdfd2949d7e8612316247ba58
1 /*
2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-11 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #ifndef __JUCER_JUCERDOCUMENTHOLDER_JUCEHEADER__
27 #define __JUCER_JUCERDOCUMENTHOLDER_JUCEHEADER__
29 #include "../model/jucer_JucerDocument.h"
30 #include "jucer_ComponentLayoutEditor.h"
31 #include "jucer_PaintRoutineEditor.h"
32 #include "jucer_ComponentLayoutPanel.h"
35 //==============================================================================
36 /**
38 class JucerDocumentHolder : public Component,
39 public ApplicationCommandTarget,
40 public ChangeListener
42 public:
43 //==============================================================================
44 JucerDocumentHolder (JucerDocument* const document);
45 ~JucerDocumentHolder();
47 JucerDocument* getDocument() const throw() { return document; }
49 bool close();
51 void refreshPropertiesPanel() const;
52 void updateTabs();
54 void showLayout();
55 void showGraphics (PaintRoutine* routine);
57 void setViewportToLastPos (Viewport* vp, EditingPanelBase& editor);
58 void storeLastViewportPos (Viewport* vp, EditingPanelBase& editor);
60 const Image createComponentLayerSnapshot() const;
62 //==============================================================================
63 void paint (Graphics& g);
64 void resized();
65 void changeListenerCallback (ChangeBroadcaster*);
67 //==============================================================================
68 ApplicationCommandTarget* getNextCommandTarget();
69 void getAllCommands (Array <CommandID>& commands);
70 void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result);
71 bool perform (const InvocationInfo& info);
73 static JucerDocumentHolder* getActiveDocumentHolder();
75 private:
76 JucerDocument* const document;
77 TabbedComponent* tabbedComponent;
78 ComponentLayoutPanel* compLayoutPanel;
80 bool isSomethingSelected() const;
81 int lastViewportX, lastViewportY;
83 double currentZoomLevel;
85 // only non-zero if a layout tab is selected
86 ComponentLayout* getCurrentLayout() const;
87 // only non-zero if a graphics tab is selected
88 PaintRoutine* getCurrentPaintRoutine() const;
90 void setZoom (double scale);
91 double getZoom() const;
93 void addElement (const int index);
94 void addComponent (const int index);
98 #endif // __JUCER_JUCERDOCUMENTHOLDER_JUCEHEADER__